package 多线程02_常见线程方法;

/**
 * @ClassName: SleepThread
 * @Author: AllenSun
 * @Date: 2022/3/18 下午8:32
 */
public class SleepThread implements Runnable {
    @Override
    public void run() {
        int second = 0;
        while (second<10) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.printf("已经玩了%d秒%n",second++);
        }
    }
}
